package javathinking.chapter5;

public class Tree {
    int height;

    /**
     * 表示树苗
     */
    Tree() {
        System.out.println("planting s seeding");
        height = 0;
    }

    /**
     * 表示一定高度的树
     *
     * @param initialHeight 高度
     */
    Tree(int initialHeight) {
        height = initialHeight;
        System.out.println("creating new Tree that is " + height + " feet tail");
    }

    void info() {
        System.out.println("Tree  is " + height + " feet tail");
    }

    void info(String s) {
        System.out.println(s + ": Tree  is " + height + " feet tail");
    }

    public static class Overloading {
        public static void main(String[] args) {
            for (int i = 0; i < 5; i++) {
                Tree t = new Tree(i);
                t.info();
                t.info("overload method");
            }
            // overloaded construct
            new Tree();
        }
    }

}
